
//
//  U9DotaCommentManager.m
//  U9WatchGame
//
//  Created by uuu9 on 2017/3/28.
//  Copyright © 2017年 Jason. All rights reserved.
//

#import "U9DotaCommentManager.h"
#import "U9DotaCommentModel.h"

@implementation U9DotaCommentManager

#pragma mark Dota评论发送接口
+ (void)commentDotaNewsWithNewsID:(NSString *)newsid andContent:(NSString *)content andUserName:(NSString *)userName andTitle:(NSString *)title andUrl:(NSString *)url andCompletionHandle:(void (^)(U9DotaCommentModel *model, NSError *error))complete{
    
    NSString *param = [NSString stringWithFormat:@"aid=%@&content=%@&username=%@&title=%@&url=%@",newsid,content,userName,title,url];
    [self POST:[NSString stringWithFormat:@"%@%@",Api_URL,kCommentDotaNews]
    parameters:param
completionHandler:^(id responseObj, NSError *error) {
    U9DotaCommentModel *model = [U9DotaCommentModel mj_objectWithKeyValues:responseObj];
    if (model.error_code != 0) {
        error = [self createError:model.error_msg];
    }
    complete(model,error);
}];
}


+(void)getCommentListWithNewsID:(NSString *)newsID andCompletionHandle:(void (^)(U9DotaCommentModel *model, NSError *error))complete{
    [self GET:[NSString stringWithFormat:@"%@%@?aid=%@&p=1&hc=10",Api_URL,kGetDotaCommentCount,newsID]
   parameters:nil
completionHandler:^(id responseObj, NSError *error) {
    U9DotaCommentModel *model = [U9DotaCommentModel mj_objectWithKeyValues:responseObj];
    if (model.error_code != 0) {
        error = [self createError:model.error_msg];
    }
    complete(model,error);
}];
    
}



@end
